Name
The name of an object is used to identify it. If more object has the same name, LiveCode will use just the first in the stack. If you have many items with the same name, you can specify it with the ID, the ID is unique and assigned by LiveCode. If a name contains spaces, use double quotes. Examples: button MyButton button "My Button" of group "My Group" of card "My Card" of stack "/Drive/Folder/Stack.rev" set the name of the target to it set the name of last card button to "Bing!" Caution! Avoid naming an object with a number. Doing so may cause LiveCode to become confused by object references that specify that number, since they might be referring to the object by name or to a different object by number. Caution! Avoid giving two controls in the same stack the same name. Doing so may cause problems if you use the Geometry pane in the property inspector or the Animation Builder. Caution! Avoid using "rev" as the first three characters of a stack's name. These characters are reserved for stacks that are part of the LiveCode development environment, and giving a non-LiveCode stack such a name may cause menus or buttons to be inappropriately disabled, or other problems. You can use the characters "rev" anywhere in a stackname except the beginning. If you want a name beginning with "rev" to appear in a stack's title bar, set the stacks' label property instead. Syntax: set the | abbr[ev[iated | short] name of object to string put the name The short name of an object is simply the name that the object has been assigned. When you set an object's name property or type it into the object's property inspector, the short name is what you provide. The abbreviated name of an object is the object's type followed by the object's short name in quotes. For example, if a player's short name is Heaven, its abbreviated name is player "Heaven". The abbreviated name is the standard name result, so put the name or put the abbreviated name is the same thing. The long name of an object includes information about its owner (and about the owner of that object, and so forth). For example, suppose a stack named "My stack" contains a card named "My Card". This card has a group named "My Group" which contains a button named "My Button". The card also has a card field named "My Field". If "My Stack" is a main stack and it's in a file whose path is "/Drive/Folder/Stack.rev", the long names of these objects look like this: * The stack: stack "/Drive/Folder/Stack.rev" * The group: group "My Group" of stack "/Drive/Folder/Stack.rev" * The card: card "My Card" of stack "/Drive/Folder/Stack.rev" * The grouped button: button "My Button" of group "My Group" of card "My Card" of stack "/Drive/Folder/Stack.rev" * The card field: field "My Field" of card "My Card" of stack "/Drive/Folder/Stack.rev" On OS X systems, standalone applications are stored as application bundles. A bundle behaves like a file but is actually a folder, and the main stack of a standalone application is inside this folder. The long name of a stack in an application is the location of the application inside the bundle, not the bundle's location. For example, if the bundle'sfile path is "/Volumes/Disk/MyApp.app/", the long name of the application's main stack might be "/Volumes/Disk/MyApp.app/Contents/MacOS/MyApp". If the stack is a substack, its name is included in the long names of its objects, before the path of the main stack: stack "My Substack" of stack "/Drive/Folder/Stack.rev" The long name of a group includes the name of the current card. If the group does not appear on the current card, requesting its name results in an execution error. If you need to get the name of a group that is not on the current card, use the "background" terminology instead. The long name of a background includes the name of the current card, if the background appears on the current card. If not, the long name of the background includes the name of the first card the background appears on. You can use an object's name to refer to the object in a statement. However, the name need not be seen on screen, even if the object is one that normally has a visible name (such as a button). If a stack or control's label property is not empty, the label property is used when a visible label is displayed. If a stack's label property is empty, its name is used as the window title. Likewise, if a control's label property is empty, its name is used as the label. This means that you can use any string you want for the name without worrying about the user-interface impact on your application: if the name is not user-friendly, set the label to something that is. A stack's name cannot be empty. (Other objects can have empty names.) Attempting to set a stack's name to empty does not rename it. If an object's name is empty, getting its name yields its ID property instead. In this case, the abbreviated ID form is always reported, regardless of what form of the name property you request. If a stack's HCAddressing property is set to true, the long or abbreviated name of a control in that stack begins with the word "background" if the control is part of a group, and with the word "card" if not. See Also: clickStack Function, mainStacks Function, nameChanged Message, hilitedButtonName Property, libURLSetLogField Command, titleWidth Property Category:Properties